package org.codegallery.javagal.thread;

public class MyTask implements Runnable{
	private volatile boolean stopRequested = false;
	public void run() {
		 while (!stopRequested) {
			  //...
		 }
		
	}
	
	public void requestStop() {
		  stopRequested = true;
		}
}
